package com.suse.service.view.edu.controller;


import com.suse.common.config.response.R;
import com.suse.service.view.edu.service.SubjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 课程分类 前端控制器
 * </p>
 *
 * @author 辜玉彬
 * @since 2022-08-16
 */
@Api(tags = "课程分类接口")
@RestController
@RequestMapping("/subject")
public class SubjectController {

    @Resource
    private SubjectService subjectService;

    @ApiOperation(value = "获取课程分类树形列表")
    @GetMapping("/tree-list")
    public R getSubjectTreeList() {
        return subjectService.getSubjectTreeList();
    }

    @ApiOperation(value = "获取课程分类一级列表和一级ID与二级列表的映射")
    @GetMapping("/firstList-and-firstIdSecondListMap")
    public R getSubjectFirstListAndFirstIdSecondListMap() {
        return subjectService.getSubjectFirstListAndFirstIdSecondListMap();
    }

}

